﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace CPPProject.Migrations
{
    public partial class insertSq : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "Email",
                table: "CPPAccount",
                maxLength: 50,
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn<DateTime>(
                name: "EndLoginTime",
                table: "CPPAccount",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "WeChtOpenID",
                table: "CPPAccount",
                maxLength: 100,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "name",
                table: "CPPAccount",
                maxLength: 50,
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn<string>(
                name: "phone",
                table: "CPPAccount",
                maxLength: 11,
                nullable: false,
                defaultValue: "");

            migrationBuilder.CreateTable(
                name: "CPPSequence",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TenantId = table.Column<int>(nullable: false),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    CreatorUserId = table.Column<long>(nullable: true),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    Seq_Name = table.Column<string>(nullable: true),
                    Seq_Desc = table.Column<string>(nullable: true),
                    Leading_Str = table.Column<string>(nullable: true),
                    Formatter = table.Column<string>(nullable: true),
                    Step = table.Column<int>(nullable: false),
                    Last_Value = table.Column<int>(nullable: false),
                    Remark = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CPPSequence", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CPPSequence");

            migrationBuilder.DropColumn(
                name: "Email",
                table: "CPPAccount");

            migrationBuilder.DropColumn(
                name: "EndLoginTime",
                table: "CPPAccount");

            migrationBuilder.DropColumn(
                name: "WeChtOpenID",
                table: "CPPAccount");

            migrationBuilder.DropColumn(
                name: "name",
                table: "CPPAccount");

            migrationBuilder.DropColumn(
                name: "phone",
                table: "CPPAccount");
        }
    }
}
